package com.xing.order.receiver;

import com.xing.order.service.OrderInfoService;
import com.xing.rabbitmq.constant.MqConst;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import sun.plugin2.message.Message;

import java.io.IOException;
import java.nio.channels.Channel;

/**
 * @author 邢福豪
 * @date 2022/8/22 15:01
 */

@Component
public class OrderReceiver {

    @Autowired
    private OrderInfoService orderService;


    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(value = MqConst.QUEUE_TASK_8,durable = "true"),
            exchange = @Exchange(value = MqConst.EXCHANGE_DIRECT_TASK),
            key = {MqConst.ROUTING_TASK_8}
    ))
    //就诊通知
    public void patientTips(Message message, Channel channel) throws IOException{
        orderService.patientTips();
    }



}
